<%@page import="java.util.List"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>座位管理</title>
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
		<link rel="stylesheet" type="text/css" href="wzxcss/roomSelect.css">
				<link rel="stylesheet" type="text/css" href="layui/css/layui.css"/>
		<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>


		 <script  type="text/javascript" src = "js/jquery-2.0.3.js"></script>
		 	 <script  type="text/javascript" src = "js/bootstrap.js"></script>
		 	 
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script src="layui/layui.all.js"></script>
<script  type="text/javascript" src = "wzxjs/seatManage.js"></script>

		<style type="text/css">
		 .control-group{
 					text-align: center;
 					padding:10px;
				}
		input[type=text]{
		height:35px;
		}
		</style>
		 	 
</head>
<body >
	<%
			//if(session.getAttribute("accountName")==null){
			//response.sendRedirect("Login.jsp");
			//}
			%>
			
	<div class="container layui-container" >
			<div class="row clearfix layui-row">
				<div class="col-md-12 column">
					<nav class="navbar navbar-default" role="navigation">

						<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
							<div class="navbar-form navbar-left" role="search">
								<div class="form-group">
									<input type="text" class="form-control" id="searchContent"  name="searchContent"/><!-- 搜索框 -->
								</div> 
								<button type="submit" class="btn btn-default" onclick="searchSeat()">搜索</button>
								<a  class="btn btn-default" data-toggle="modal"  href="#myModal_addSeatByNum">批量添加</a>
								<a  class="btn btn-default" data-toggle="modal"  href="#myModal_deleSeatByNum">批量删除</a>
							</div>
							<ul class="nav navbar-nav navbar-right">
								<li>
									 <a href="#">返回</a>
								</li>
							</ul>
						</div>
						
					</nav>
					<table class="table table-striped table-bordered table-hover  layui-table"  id="seatTable"><!-- 自习室表格信息 -->
					<colgroup>
                        <col width="50">
                        <col width="100">
                        <col width="150">
                        <col width="150">
                        <col width="150">
                    </colgroup>
						<thead>
							<tr  >
							<th ><input type="checkbox" name="" id="selectAll" value="全选" />全选<input type="checkbox" name="" id="reverseSelect"  value="反选" />反选</th>
							<th style="text-align: center">座位编号</th>
							<th style="text-align: center">自习室编号</th>
                            <th style="text-align: center">座位状态</th>
                            <th style="text-align: center"><button type="button" class="layui-btn layui-btn-danger btn-del" >删除</button></th>
						</tr>
						</thead>
						   <tbody id="tbody1">
						   </tbody>
					</table>
					<div id="pagediv"></div>
					
	<!-- 批量添加座位遮罩层 -->     
	<form id="myModal_addSeatByNum" class="modal fade" name="myModal"  onsubmit="return false" method="post" action="" style="display:none"> <!-- 遮罩层表单 -->
	         <div class="modal-dialog"  >
		       <div class="modal-content" >
			         <div class="modal-header" >   
                         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">关闭</button>
                         <h4>批量添加座位</h4> 
                     </div>
                      <div class="modal-body">
                         <fieldset>
                            <div class="control-group" >
                            <label class="control-label" for="studyRoomLocation">自习室编号:</label>
                            <input type="text"  name="studyRoomNo" id="study_Room_No_add" >
                            </div>
                            <div class="control-group">
                            <label class="control-label" for="seatNum">添加座位数:</label>
                            <input type="text" name="seatNum" id="seat_Num_add" >
                            </div>
                            </fieldset>
                       </div>
                       <div class="modal-footer">
                            <input type="submit" id="add_Btn" class="btn btn-primary" value="确认" onclick="addSeatByNum()"  > <input type="button" class="btn" value="取消" data-dismiss="modal">
                            <input type="reset" name="reset" style="display:none">
                           <!-- 处理重复提交操作的一个 token 令牌，表单提交，令牌也提交 -->
							<%
							   //重复提交 I. 在session范围内产生一个token的值。
								session.setAttribute("token", System.nanoTime() + "");
							%>
							<!-- 重复提交 II 将token通过隐藏域传递给servlet -->
							<input type="hidden" name="token" value="${sessionScope.token}">
                       </div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</form>             
	<!-- 批量删除座位遮罩层 -->     
	<form id="myModal_deleSeatByNum" class="modal fade" name="myModal"  onsubmit="return false" method="post" action="" style="display:none"> <!-- 遮罩层表单 -->
	         <div class="modal-dialog"  >
		       <div class="modal-content" >
			         <div class="modal-header" >   
                         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">关闭</button>
                         <h4>批量删除座位</h4> 
                     </div>
                      <div class="modal-body">
                         <fieldset>
                            <div class="control-group" >
                            <label class="control-label" for="studyRoomLocation">自习室编号:</label>
                            <input type="text"  name="studyRoomNo" id="study_Room_No_dele" >
                            </div>
                            <div class="control-group">
                            <label class="control-label" for="seatNum">删除座位数:</label>
                            <input type="text" name="seatNum" id="seat_Num_dele" >
                            </div>
                            </fieldset>
                       </div>
                       <div class="modal-footer">
                            <input type="submit" id="add_Btn" class="btn btn-primary" value="确认" onclick="deleSeatByNum()"  > <input type="button" class="btn" value="取消" data-dismiss="modal">
                            <input type="reset" name="reset" style="display:none">
                           <!-- 处理重复提交操作的一个 token 令牌，表单提交，令牌也提交 -->
							<%
							   //重复提交 I. 在session范围内产生一个token的值。
								session.setAttribute("token", System.nanoTime() + "");
							%>
							<!-- 重复提交 II 将token通过隐藏域传递给servlet -->
							<input type="hidden" name="token" value="${sessionScope.token}">
                       </div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</form>    
				</div>
			</div>
		</div>
</body>
</html>